//package com.example.demo.conf;
//
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.CorsConfiguration;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//@Configuration
//public class CorsConfig implements WebMvcConfigurer {
//    @Override
//    public void addCorsMappings(CorsConfigurationRegistry registry) {
//        CorsConfiguration config = new CorsConfiguration();
//        config.addAllowedOrigin("http://localhost:3000");
//        config.addAllowedMethod("*");
//        config.addAllowedHeader("*");
//        registry.addMapping("/**")
//                .allowedOrigins(config.getAllowedOrigins())
//                .allowedMethods(config.getAllowedMethods())
//                .allowedHeaders(config.getAllowedHeaders());
//    }
//}